#ifndef __W25Q64_H__
#define __W25Q64_H__

#define W25Q64_WRITE_ENABLE								0x06
#define W25Q64_WRITE_DISABLE							0x04
#define W25Q64_READ_STATUS_REGISTER_1			0x05
#define W25Q64_READ_STATUS_REGISTER_2			0x35
#define W25Q64_WRITE_STATUS_REGISTER			0x01
#define W25Q64_PAGE_PROGRAM								0x02
#define W25Q64_QUAD_PAGE_PROGRAM					0x32
#define W25Q64_BLOCK_ERASE_64KB						0xd8
#define W25Q64_BLOCK_ERASE_32KB						0x52
#define W25Q64_SECTOR_ERASE_4KB						0x20
#define W25Q64_CHIP_ERASE									0xc7
#define W25Q64_ERASE_SUSPEND							0x75
#define W25Q64_ERASE_RESUME								0x7a
#define W25Q64_POWER_DOWN									0xb9
#define W25Q64_HIGH_PERFORMANCE_MODE			0xa3
#define W25Q64_CONTINUOUS_READ_MODE_RESET	0xff
#define W25Q64_RELEASE_POPWER_DOWN_HPM_DEVICE_ID	0xab
#define W25Q64_MANUFACTURER_DEVICE_ID			0x90
#define W25Q64_READ_UNIQUE_ID							0x4b
#define W25Q64_JEDEC_ID										0x9f
#define W25Q64_READ_DATA									0x03
#define W25Q64_FAST_READ									0X0B
#define W25Q64_FAST_READ_DUAL_OUTPUT			0X3B
#define W25Q64_FAST_READ_DUAL_IO					0xbb
#define W25Q64_FAST_READ_QUAD_OUTPUT			0x6b
#define W25Q64_FAST_READ_QUAD_IO					0xeb
#define W25Q64_OCTAL_WORD_READ_QUAD_IO		0xe3

void W25Q64_Init(void);
void W25Q64_ReadID(u8 *MID,u16 *DID);
void W25Q64_PageProgram(u32 addr,u8 *DataArray,u16 count);
void W25Q64_SectorErase(u32 addr);
void W25Q64_ReadData(u32 addr,u8 *DataArray,u32 count);
#endif
